export function getUrlQuery() {
  var vars = {};
  window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function(
    m,
    key,
    value
  ) {
    vars[key] = value;
  });
  return vars;
}

export function formatNum(num) {
  let intReg = /^([0-9]+|0)$/;
  let floatReg = /^(([0-9]+|0)\.([0-9]+))$/;
  num = num / 100;
  if (intReg.test(num)) {
    return num.toFixed(0);
  } else if (floatReg.test(num)) {
    return num.toFixed(2);
  }
  return 0;
}

//返回类型
export function typeOf(param) {
  return Object.prototype.toString.call(param).slice(8, -1);
}
